using System.IO;

namespace PhotoFramePublishingPlugin
{
    internal static class StreamHelper
    {
        public static void Copy(Stream source, Stream destination)
        {
            const int bufferLength = 16 * 1024 * 1024;
            byte[] buffer = new byte[bufferLength];

            for (; ; )
            {
                int bytesRead = source.Read(buffer, 0, bufferLength);
                if (bytesRead == 0)
                    break;

                destination.Write(buffer, 0, bytesRead);
            }
        }
    }
}
